<?php
  if(!$_COOKIE['UserID']){
    HEADER("location:./login.html");
  }
  include "./php/pdo-plus/src/PDO.class.php";
  include "./php/fn.php";
  include "./php/config.php";
  $db=DB::getInstance($database);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
<style type="text/css">
.ys01 {
	font-size: 24px;
}
.ys01 {
	font-size: 36px;
}
.ys01 {
	font-size: 14px;
}
.ys01 {
	font-size: 12px;
}
.ys02 {
	text-align: left;
	font-size: 36px;
}
.ys03 {
	font-size: 24px;
	font-weight: bold;
}
.ys04 {
	color: #F00;
	font-size: 24px;
}
.ys05 {
	font-size: 16px;
}
.ys06 {
	font-size: 14px;
}
.ys04 {
}
.ys04 .ys04 .ys04 {
	text-align: left;
}
</style>
</head>

<body >
<table width="100%" border="0" align="center">
  <tr>
    <th scope="col"><table width="100%" border="0" align="center">
      <?php include "./header.php";?>
    </table>
      <table width="100%" border="0" align="center">
        <tr>
          <th scope="col"><table width="100%" border="0">
            <tr>
              <th height="450" scope="col"><img src="主图.jpg" width="1740" height="600" alt="主图" /></th>
            </tr>
          </table>
            <table width="1000" border="0" align="center">
            <tr>
              <th scope="col"><table width="100%" border="0">
                <tr>
                  <th height="80" class="ys02" scope="col">精选房源</th>
                </tr>
                <tr>
                  <th scope="row"><table width="100%" border="0">
                    <tr>
                      <?php
                        $sql="SELECT * FROM fang where xuanshang=0 limit 3";
                        $fangs=$db->query($sql);
                        foreach ($fangs as $key => $value) {
                          ?>
                      <th scope="col"><table width="300" border="1" align="center">
                        <tr>
                          <th height="200" scope="col">
                            <img src="./upload/<?php echo $value['mainimg']; ?>" alt="" />
                          </th>
                        </tr>
                        <tr>
                          <th height="35" scope="row"><table width="90%" border="0">
                            <tr>
                              <th height="35" scope="col"><span class="ys04"><span class="ys04"><span class="ys04">¥ <?php echo $value['price']; ?><span class="ys06">元/月</span></span></span></span></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><span class="ys05"><?php echo $value['xiaoqu']; ?>，<?php echo $value['shi']; ?>室<?php echo $value['ting']; ?>厅，<?php echo $value['chaoxiang']; ?>，<?php echo $value['dizhi']; ?></span></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><span class="ys06"><?php echo $value['info']; ?></span></th>
                            </tr>
                          </table></th>
                        </tr>
                      </table></th>
                          <?php
                        }
                       ?>
                    </tr>
                    <tr>
                      <?php
                        $sql="SELECT * FROM fang where xuanshang=0 limit 3,3";
                        $fangs=$db->query($sql);
                        foreach ($fangs as $key => $value) {
                          ?>
                      <th scope="col"><table width="300" border="1" align="center">
                        <tr>
                          <th height="200" scope="col">
                            <img src="./upload/<?php echo $value['mainimg']; ?>" alt="" />
                          </th>
                        </tr>
                        <tr>
                          <th height="35" scope="row"><table width="90%" border="0">
                            <tr>
                              <th height="35" scope="col"><span class="ys04"><span class="ys04"><span class="ys04">¥ <?php echo $value['price']; ?><span class="ys06">元/月</span></span></span></span></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><span class="ys05"><?php echo $value['xiaoqu']; ?>，<?php echo $value['shi']; ?>室<?php echo $value['ting']; ?>厅，<?php echo $value['chaoxiang']; ?>，<?php echo $value['dizhi']; ?></span></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><span class="ys06"><?php echo $value['info']; ?></span></th>
                            </tr>
                          </table></th>
                        </tr>
                      </table></th>
                          <?php
                        }
                       ?>
                    </tr>
                  </table></th>
                </tr>
              </table></th>
            </tr>
            <tr>
              <th scope="row"><table width="100%" border="0">
                <tr>
                  <th height="80" class="ys02" scope="col">整租.样板</th>
                </tr>
                <tr>
                  <?php
                    $sql="SELECT * from yangban where fangshi=1 limit 1";
                    $yangban=$db->query($sql);
                   ?>
                  <th scope="row"><table width="100%" border="0">
                    <tr>
                      <th width="75%" height="450" scope="col">
                        <img src="./upload/<?php echo $yangban[0]['mainimg'];?>" alt="" />
                      </th>
                      <th height="450" scope="col"><table width="100%" border="0">
                        <?php
                          $imgs=json_decode($yangban[0]['imgs'],true);
                          foreach ($imgs as $key => $value) {
                            ?>
                        <tr>
                          <th height="150" scope="col">
                            <img src="./upload/<?php echo $value;?>" alt="" />
                          </th>
                        </tr>
                            <?php
                          }
                         ?>

                      </table></th>
                    </tr>
                  </table></th>
                </tr>
              </table></th>
            </tr>
            <tr>
              <th scope="row"><table width="100%" border="0">
                <tr>
                  <th height="80" class="ys02" scope="col">合租.样板</th>
                </tr>
                <tr>
                  <?php
                    $sql="SELECT * from yangban where fangshi=0 limit 1";
                    $yangban=$db->query($sql);
                   ?>
                  <th scope="row"><table width="100%" border="0">
                    <tr>
                      <th width="75%" height="450" scope="col">
                        <img src="./upload/<?php echo $yangban[0]['mainimg'];?>" alt="" />
                      </th>
                      <th height="450" scope="col"><table width="100%" border="0">
                        <?php
                          $imgs=json_decode($yangban[0]['imgs'],true);
                          foreach ($imgs as $key => $value) {
                            ?>
                        <tr>
                          <th height="150" scope="col">
                            <img src="./upload/<?php echo $value;?>" alt="" />
                          </th>
                        </tr>
                            <?php
                          }
                         ?>
                      </table></th>
                    </tr>
                  </table></th>
                </tr>
              </table></th>
            </tr>
            <tr>
              <th scope="row"><table width="100%" border="0">
                <tr>
                  <th height="80" class="ys02" scope="col">悬赏出租</th>
                </tr>
                <tr>
                  <th scope="row"><table width="100%" border="0">
                    <tr>
                  <?php
                    $sql="SELECT * from fang  where xuanshang=1 limit 3";
                    $xuanshangs=$db->query($sql);
                    foreach ($xuanshangs as $key => $value) {
                      ?>
                      <th scope="col"><table width="300" border="1" align="center">
                        <tr>
                          <th height="200" scope="col">
                            <img src="./upload/<?php echo $value['mainimg'];?>" alt="" />
                          </th>
                        </tr>
                        <tr>
                          <th height="35" scope="row"><?php echo $value['price'];?>vs<?php echo $value['reward'];?></th>
                        </tr>
                        <tr>
                          <th height="10" scope="row"><?php echo $value['xiaoqu']; ?>，<?php echo $value['shi']; ?>室<?php echo $value['ting']; ?>厅，<?php echo $value['chaoxiang']; ?>，<?php echo $value['dizhi']; ?></th>
                        </tr>
                        <tr>
                          <th height="10" scope="row"><?php echo $value['info'];?></th>
                        </tr>
                      </table></th>

                      <?php
                    }
                   ?>

                    </tr>
                    <tr>
                      <?php
                        $sql="SELECT * from fang  where xuanshang=1 limit 3,3";
                        $xuanshangs=$db->query($sql);
                        foreach ($xuanshangs as $key => $value) {
                          ?>
                          <th scope="col"><table width="300" border="1" align="center">
                            <tr>
                              <th height="200" scope="col">
                                <img src="./upload/<?php echo $value['mainimg'];?>" alt="" />
                              </th>
                            </tr>
                            <tr>
                              <th height="35" scope="row"><?php echo $value['price'];?>vs<?php echo $value['reward'];?></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><?php echo $value['xiaoqu']; ?>，<?php echo $value['shi']; ?>室<?php echo $value['ting']; ?>厅，<?php echo $value['chaoxiang']; ?>，<?php echo $value['dizhi']; ?></th>
                            </tr>
                            <tr>
                              <th height="10" scope="row"><?php echo $value['info'];?></th>
                            </tr>
                          </table></th>

                          <?php
                        }
                       ?>
                    </tr>
                  </table></th>
                </tr>
              </table></th>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
            </tr>
          </table></th>
        </tr>
      </table>
      <table width="100%" border="0">
        <tr>
          <th scope="col"><table width="1000" border="0" align="center">
            <tr>
              <th width="18%" height="200" scope="col"><table width="100%" border="0">
                <tr>
                  <th height="30" class="ys03" scope="col">用户帮助</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table>
                <table width="100%" border="0">
                  <tr>
                    <th scope="col">入住指南</th>
                  </tr>
                  <tr>
                    <th scope="row">生活常识</th>
                  </tr>
                  <tr>
                    <th scope="row">常见问题</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                </table></th>
              <th width="18%" height="200" scope="col"><table width="100%" border="0">
                <tr>
                  <th height="30" class="ys03" scope="col">商务合作</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table>
                <table width="100%" border="0">
                  <tr>
                    <th scope="col">商务合作</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                </table></th>
              <th width="18%" height="200" scope="col"><table width="100%" border="0">
                <tr>
                  <th height="30" class="ys03" scope="col">公司信息</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table>
                <table width="100%" border="0">
                  <tr>
                    <th scope="col">关于我们</th>
                  </tr>
                  <tr>
                    <th scope="row">联系我们</th>
                  </tr>
                  <tr>
                    <th scope="row">加入我们</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                </table></th>
              <th width="18%" height="200" scope="col"><table width="100%" border="0">
                <tr>
                  <th height="30" class="ys03" scope="col">客服热线</th>
                </tr>
                <tr>
                  <th scope="row"><table width="100%" border="0">
                    <tr>
                      <th scope="col">0311-5555555</th>
                    </tr>
                    <tr>
                      <th scope="row">工作日 09:00-21:00</th>
                    </tr>
                    <tr>
                      <th scope="row">&nbsp;</th>
                    </tr>
                    <tr>
                      <th scope="row">&nbsp;</th>
                    </tr>
                  </table></th>
                </tr>
              </table></th>
              <th height="200" scope="col"><table width="100%" border="1">
                <tr>
                  <th scope="col">APP二维码</th>
                  <th scope="col">公众号二维码</th>
                </tr>
              </table></th>
            </tr>
          </table></th>
        </tr>
      </table>
      <table width="100%" border="0" align="center">
        <tr>
          <th bgcolor="#CCCCCC" scope="col"><table width="1000" border="0" align="center">
            <tr>
              <th width="20%" height="80" scope="col"><img src="logo.jpg" width="90" height="60" alt="logo" /></th>
              <th height="80" scope="col"><table width="90%" border="0">
                <tr>
                  <th class="ys01" scope="col">寓萌——公寓&amp;中介完美合作平台</th>
                </tr>
                <tr>
                  <th class="ys01" scope="row">本网站所有页面的数据统计均来源于寓萌数据库   联系客服：微信 周一至周日09:00-22:00</th>
                </tr>
              </table></th>
              <th width="15%" height="80" scope="col"><img src="标志.png" width="90" height="60" alt="标志" /></th>
            </tr>
          </table></th>
        </tr>
    </table></th>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<script>
  window.onload=function(){

  console.log(document.body.scrollWidth-document.body.offsetWidth);
  setTimeout(function(){
  window.scrollTo((document.body.scrollWidth-document.body.offsetWidth)/2,0);
  },0);
  }
</script>